<template>
  <div class="breadcrumb">
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item  v-for="item in breadlist" :key="item.path">{{item.meta.title}}</el-breadcrumb-item>

    </el-breadcrumb>
  </div>
</template>

<script>
export default{
  data(){
    return{
      breadlist:[]
    }
  },
  watch:{
    $route(to,form){  //监听路由对象的数据改变
      this.breadlist=to.matched;
    }
  },
  methods:{
    getlist(){

    }
  },
  mounted(){
    this.breadlist=this.$route.matched;  //加载完成之后，拿到和路由对象配置层级相同的数组
    console.log(this.$route.matched);
  }
}
</script>


<style>
</style>
